/**************************************************************************************
*
*	Copyright (C) 2009 - 2012 Brent Andrew O. Chua - See LICENSE.txt for more info.
*		
*	Filename	-	Light.h
*
*	Description -	Light model
*
*	Comments	-	
*
*	Modification History:
*			Name			   Date					Description
*			MrCodeSushi	-	01/30/2013	-	Creation of this file
**************************************************************************************/
#ifndef _PSX_LIGHT_H_
#define _PSX_LIGHT_H_

#include "PulseSTD.h"
#include "GraphicsTypes.h"
#include "Vector3.h"
#include "ParameterContainer.h"

namespace Pulse
{
	class Light
	{
	public:

		Light( void ) 
			: m_color( 1.0f, 1.0f, 1.0f ), m_range( 2.0f ), m_spotInnerAngle( 0 ),
			m_spotOuterAngle( 0 ), m_type( ELight::POINT ) 
		{
		}

		const ELight::Type GetType( void ) const { return m_type; }

		void SetType( ELight::Type type ) { m_type = type; }

		//const Vector3 * GetPosition( void ) const { return &m_position; }

		//void SetPosition( const Vector3 *pPos ) { m_position = *pPos; }

		const Vector3 * GetColor( void ) const { return &m_color; }

		void SetColor( const Vector3 *pColor ) { m_color = *pColor; }

		//const Vector3 * GetDirection( void ) const { return &m_direction; }

		//void SetDirection( const Vector3 *pDirection ) { m_direction = *pDirection; }

		const FLOAT GetRange( void ) const { return m_range; }

		void SetRange( const FLOAT range ) { m_range = range; }

		const FLOAT GetInnerAngle( void ) const { return m_spotInnerAngle; }

		void SetInnerAngle( const FLOAT innerAngle ) { m_spotInnerAngle = innerAngle; }

		const FLOAT GetOuterAngle( void ) const { return m_spotOuterAngle; }

		void SetOuterAngle( const FLOAT outerAngle ) { m_spotOuterAngle = outerAngle; }

	public:

		IParameterBinder * AddParameter( IParameter *pParam );

		void ClearParameters( void );

		ParameterContainer * GetParameterContainer( void ) { return &m_params; }
		
		const ParameterContainer * GetParameterContainer( void ) const { return &m_params; }

	private:

		friend ComponentLight;

        ELight::Type	m_type;
		//Vector3			m_position;
        Vector3			m_color;
        //Vector3			m_direction;
        FLOAT			m_range;
        FLOAT			m_spotInnerAngle;
        FLOAT			m_spotOuterAngle;

		ParameterContainer	m_params;

	};
}

#endif /* _PSX_LIGHT_H_ */